package zhang.lao.console.controller.wn.excel;/**
 * Created by zhangqin on 2017/10/10.
 */

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import zhang.lao.console.service.ImportGt06Service;
import zhang.lao.pojo.console.resp.HttpResult;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

/**
 * @author
 * @create 2017-10-10 15:57
 **/
@Controller
public class ImportGt06 {

    @Autowired
    private ImportGt06Service importGt06Service;

    @RequestMapping(value = "/console/excel/upload/device")
    public @ResponseBody HttpResult upExcel() throws FileNotFoundException {
        InputStream is2 = new FileInputStream("E:\\定位设备表.xls");

        return importGt06Service.upExcel(is2);
    }

    @RequestMapping(value = "/console/excel/upload/machine")
    public @ResponseBody HttpResult upExcelMachine() throws FileNotFoundException {
        InputStream is2 = new FileInputStream("E:\\农机表.xls");
        return importGt06Service.upExcelMachine(is2);
    }

}
